<?php

/* @var $this \yii\web\View */

/* @var $content string */

use yak\layui\widgets\LayuiView;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yak\layui\models\Menu;
use yak\layui\assets\YakAsset;
use yak\layui\helper\ConfigHelper;

YakAsset::register($this);

$env = [
    'BASE_URL' => '/modules'
];

$this->registerJs(ConfigHelper::env($env), \yii\web\View::POS_HEAD);

$theme = ConfigHelper::theme();
$this->registerCss($theme['theme'], ['id' => 'LAY_layadmin_theme']);

?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php $this->registerCsrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body class="layui-layout-body layadmin-tabspage-none">
<?php $this->beginBody() ?>
<div id="LAY_app" class="<?= $theme['shrink'] ?>">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">

            <!-- 头部区域（可配合layui已有的水平导航） -->
            <?= \yak\layui\widgets\layout\Menus::widget(['tData' =>
                Menu::menuData(Menu::POS_TOP_LEFT),
                'linker' => ArrayHelper::getValue($this->params, 'link', '')
            ]) ?>

            <?= \yak\layui\widgets\layout\Menus::widget(['tData' =>
                Menu::menuData(Menu::POS_TOP_RIGHT),
                'linker' => false, 'layout' => 'layui-layout-right', 'type' => 'right',
                'ulOptions' => [
                    'lay-filter' => "layadmin-layout-right"
                ]
            ]) ?>

        </div>

        <div class="layui-side layui-side-menu">

            <?= \yak\layui\widgets\layout\Logo::widget([]) ?>

            <?= \yak\layui\widgets\layout\Menus::widget(['tData' =>
                Menu::menuData(), 'layout' => 'layui-nav-tree', 'type' => 'side',
                'linker' => ArrayHelper::getValue($this->params, 'link', ''),
                'ulOptions' => [
                    'lay-shrink' => "all", 'id' => "LAY-system-side-menu", 'lay-filter' => "layadmin-system-side-menu"
                ]
            ]) ?>

        </div>

        <div class="layui-body">


            <div class="layui-card layadmin-header">
                <?= \yak\layui\widgets\layout\Breadcrumbs::widget([
                    'links' => ArrayHelper::getValue($this->params, 'breadcrumbs', []),
                ]) ?>
            </div>

            <div class="layui-fluid layadmin-fluid">
                <div class="layui-row layadmin-row">

                    <!-- 内容主体区域 -->
                    <?= \yak\layui\widgets\layout\Alert::widget() ?>

                    <?php LayuiView::begin() ?>

                    <?= $content ?>

                    <?php LayuiView::end() ?>

                </div>
            </div>

        </div>

        <div class="layui-footer">
            <!-- 底部固定区域 -->
            <p>© 2020 <?= \yak\layui\helper\YakHelper::config('company', 'company')?></p>
        </div>
    </div>
</div>
<iframe frameborder="0" layui-hide name="yak-iframe"></iframe>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
